//
// Created by zhouwd on 2020/3/9.
//

#ifndef LEARNNEW_RENDER_H
#define LEARNNEW_RENDER_H

#include <EGL/egl.h>
#include <GLES3/gl3.h>
#include <cstdlib>
#include <cstring>
#include <jni.h>
#include <android/log.h>
#define LOG_TAG "OPENGL-RENDER"
#define ALOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)

typedef class OPENGL_LEARN_RENDER {
private:
    GLuint program, image1, image2, image3;
    GLint textureImage1, textureImage2, textureImage3;
    GLuint createShader(GLenum shaderType, const char* src);
    GLuint createProgram(const char* vtxSrc, const char* fragSrc);

public:
    int init(char *mPreviewFragmentShaderBuffer,char *mPreviewVertexShaderBuffer);
    int resize(int width, int height);
    int step();
    int setPicTexture(char *data, int size, int width, int height);
    int change();
} OpenglRender;

#endif //LEARNNEW_RENDER_H
